package com.baobaotao.advice;

import org.aopalliance.intercept.MethodInterceptor;
import org.aopalliance.intercept.MethodInvocation;



public class GreetingAroundAdvice implements MethodInterceptor{

	@Override
	public Object invoke(MethodInvocation invocation) throws Throwable {
		Object[] args=invocation.getArguments();//目标方法入参
		String clienName=(String)args[0];
		System.out.println("How are you!Mr."+clienName);
		Object obj=invocation.proceed();//通过反射机制调用目标方法
		//System.out.println("obj"+obj);
		System.out.println("Please enjoy yourself");
		return obj;
	}


	}


